import request from '@/utils/request'

// 封装获取部门结构函数
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}
// 封装删除部门的请求接口
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
// 封装负责人数据
export function getEmployeeSimple() {
  return request({
    url: '/sys/user/simple'
  })
}
// 新增部门
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}
// 获取部门详情数据接口
export function getDepartmentDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}
// 编辑部门请求接口
export function editDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
